<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <div></div>

    <script>

        var oDiv = document.querySelector('div');

        // 给对象添加自定义属性
        oDiv.suiBian = 0;

        // 给标签添加自定义属性  会在标签上显示
        oDiv.setAttribute('suiBian', 2);


        console.log(oDiv.suiBian);


        console.log(oDiv.getAttribute('suiBian'));


    </script>

</body>

</html>